package com.spic.business.violation.supervision.information.controller;

import com.spic.business.common.core.utils.poi.BusinessExcelUtil;
import com.spic.business.common.core.workflow.IWorkFlowService;
import com.spic.business.common.core.workflow.WorkFlowController;
import com.spic.business.violation.supervision.information.domain.ViolationInformation;
import com.spic.business.violation.supervision.information.domain.ViolationInformationDirty;
import com.spic.business.violation.supervision.information.service.IViolationInformationDirtyService;
import com.spic.business.violation.supervision.information.service.IViolationInformationService;
import com.spic.common.core.utils.poi.ExcelUtil;
import com.spic.common.core.web.controller.BaseController;
import com.spic.common.core.web.domain.AjaxResult;
import com.spic.common.core.web.page.TableDataInfo;
import com.spic.common.log.annotation.Log;
import com.spic.common.log.enums.BusinessType;
import com.spic.common.security.annotation.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.spic.business.xfalarm.PageUtils.startPage;


/**
 * 违章举报Controller
 *
 * @author spic
 * @date 2021-10-14
 */
@RestController
@RequestMapping("/violation/information/dirty")
public class ViolationInformationDirtyController extends BaseController
{
    @Autowired
    private IViolationInformationDirtyService violationInformationDirtyService;
    /**
     * 查询违章举报列表
     */
    @GetMapping("/list")
    public TableDataInfo list(ViolationInformationDirty violationInformation)
    {
        startPage();
        List<ViolationInformationDirty> list = violationInformationDirtyService.selectViolationInformationDirtyList(violationInformation);
        return getDataTable(list);
    }

    @GetMapping("statistics")
    public AjaxResult statistics() {
        Map<String, Integer> map = violationInformationDirtyService.statistics();
        return AjaxResult.success(map);
    }
}
